<!DOCTYPE html>

<html>
	<title> 新增设备 </title>
	<head>
		<meta http-equiv="Content-Type" content="text/css; charset=utf-8">
		<link rel="stylesheet" href="{{ static_url("css/button.css") }}">
		<script src="{{ static_url("js/jquery.min.js")}}"></script>

		<style type="text/css">
			body {
				background:		#e0f0e9;
				/*text-align: 	center;*/
				font-family: 	verdana;
			}

			div.content {
				margin-left: 	4cm;
				margin-top: 	2cm;
			}

			span.item {
				display:		-moz-inline-box;
				display:		inline-block;
				width:			200px; 
				margin-bottom: 	10px;
			}

		</style>

	</head>
	
	<body>

		<div class="content">
			<form action='/manage/upload_zip' enctype="multipart/form-data" method='post'>
	            <h3>上传zip包:</h3>
	            <span class="item"> 选择zip文件 </span>:
	            <span class="item"> <input id= "file" type="file" name="file" accept=".zip"/></span> </br>
	            
	            <span class="item"> md5 </span>:
	            <span class="item"> <input id="md5" name="md5" type="text" value="" style="width:300px"/></span> </br>
	            
	            <span class="item"> 指纹号(finger_point) </span>:
	            <span class="item"> <input id="finger_point" name="finger_point" type="text" value="" style="width:300px"/></span> </br>
	            
	            <span class="item"> 更新说明(infos) </span>:
	            <span class="item"> <textarea id="infos" name="infos" style="width:300px; height:50px" warp="virtual" ></textarea> </span> </br>

	            <div style="margin: 1cm 0cm 0cm 2cm">
	            	<input type='submit' value='上传' class="button" style="padding: 0px 15px 0px 15px;" />
	            	<a href="/" class="button"> 首页 </a>
	            </div>
            </form>
    	</div>

	</body>
</html>


<script type="text/javascript">

	$('form').submit(function(){
		var md5 = $("input#md5").val();
		var finger_point = $("input#finger_point").val();
		var infos = $("textarea#infos").val();
		console.log('md5 = ' + md5);
		console.log('finger_point = ' + finger_point);
		console.log('infos = ' + infos);

		if (md5 == "") {
			alert("请填写 【md5】 ！");
			return false;
		}
		if (finger_point == "") {
			alert("请填写 【指纹号】 ！");
			return false;
		}
		if (infos == "") {
			alert("请填写 【更新说明】 ！");
			return false;
		}

		$(this).serialize();
		return true;
	});

</script>
